package cn.iocoder.yudao.module.resource.convert;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.resource.controller.admin.advertiser.vo.ResourceAdvertiserRespVO;
import cn.iocoder.yudao.module.resource.dal.dataobject.advertiser.ResourceAdvertiserDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

@Mapper
public interface ResourceAdvertiserConvert {

    ResourceAdvertiserConvert INSTANCE = Mappers.getMapper(ResourceAdvertiserConvert.class);

    default ResourceAdvertiserRespVO convert(ResourceAdvertiserDO bean) {
        return BeanUtils.toBean(bean, ResourceAdvertiserRespVO.class);
    }

    default PageResult<ResourceAdvertiserRespVO> convertPage(PageResult<ResourceAdvertiserDO> page) {
        return BeanUtils.toBean(page, ResourceAdvertiserRespVO.class);
    }

}
